package cn.iocoder.yudao.module.member.controller.app.cardsecurity;


import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.module.member.controller.app.cardsecurity.vo.UploadSaveReqVO;
import cn.iocoder.yudao.module.member.service.cardsecurity.CardSecurityUploadService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.validation.Valid;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;


@Tag(name = "前端 - 证书上传表	")
@RestController
@RequestMapping("/certificate/upload")
@Validated
public class CardSecurityUploadController {

        @Resource
        private CardSecurityUploadService cardSecurityUploadService;

        @PostMapping("/create")
        @Operation(summary = "创建证书上传表	")
        @PreAuthorize("@ss.hasPermission('certificate:upload:create')")
        public CommonResult<Integer> createUpload(@Valid @RequestBody UploadSaveReqVO createReqVO) {
            return success(cardSecurityUploadService.createUpload(createReqVO));
        }






//        @GetMapping("/page")
//        @Operation(summary = "获得证书上传表	分页")
//        @PreAuthorize("@ss.hasPermission('certificate:upload:query')")
//        public CommonResult<PageResult<UploadRespVO>> getUploadPage(@Valid UploadPageReqVO pageReqVO) {
//            PageResult<UploadDO> pageResult = uploadService.getUploadPage(pageReqVO);
//            return success(BeanUtils.toBean(pageResult, UploadRespVO.class));
//        }




}
